var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var UI_BoxLevelInfo_UIBindings = require("AA_UI_BoxLevelInfo_UIBindings");
var UIView = require("AA_UIView");
var HallManager = require("AA_HallManager");
var Excel = require("AA_Excel");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_UI_BoxLevelInfo = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.auto_ui = null;
    t.currLevel = 0;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype._show = function () {
    this.currLevel = HallManager.HallMgr.shopData.boxLevel;
    this.firstBoxData = Excel.Excel.shopBoxLevel(1);
    this.ShowLevel(this.currLevel);
  };
  _creator.prototype._clickListener = function (e) {
    switch (e) {
      case this.auto_ui.btn_closeBtn:
        this._close();
        break;
      case this.auto_ui.btn_lastBtn:
        this.currLevel--;
        this.ShowLevel(this.currLevel);
        break;
      case this.auto_ui.btn_nextBtn:
        this.currLevel++;
        this.ShowLevel(this.currLevel);
    }
  };
  _creator.prototype.ShowLevel = function (e) {
    this.currLevel = e;
    var t = this.auto_ui;
    t.txt_levelLbael.string = "LV." + (e + 1);
    t.btn_lastBtn.node.active = e > 0;
    t.btn_nextBtn.node.active = e < Excel.Excel.shopBoxLevel_all.size - 1;
    var o = Excel.Excel.shopBoxLevel(e + 1);
    t.txt_box1LvLabel.node.parent.active = o.rewards[0] > 0;
    t.txt_box1LvLabel.string = "+" + (o.rewards[0] - this.firstBoxData.rewards[0]);
    t.txt_box1LanLabel.node.parent.active = o.rewards[1] > 0;
    t.txt_box1LanLabel.string = "+" + (o.rewards[1] - this.firstBoxData.rewards[1]);
    t.txt_box1ZiLabel.node.parent.active = o.rewards[2] > 0;
    t.txt_box1ZiLabel.string = "+" + (o.rewards[2] - this.firstBoxData.rewards[2]);
    t.txt_box2LvLabel.node.parent.active = o.bigRewards[0] > 0;
    t.txt_box2LvLabel.string = "+" + (o.bigRewards[0] - this.firstBoxData.bigRewards[0]);
    t.txt_box2LanLabel.node.parent.active = o.bigRewards[1] > 0;
    t.txt_box2LanLabel.string = "+" + (o.bigRewards[1] - this.firstBoxData.bigRewards[1]);
    t.txt_box2ZiLabel.node.parent.active = o.bigRewards[2] > 0;
    t.txt_box2ZiLabel.string = "+" + (o.bigRewards[2] - this.firstBoxData.bigRewards[2]);
  };
  __decorate([_property(UI_BoxLevelInfo_UIBindings.default)], _creator.prototype, "auto_ui", undefined);
  return __decorate([_ccclass], _creator);
}(UIView.default);
exports.default = _def_UI_BoxLevelInfo;